<script>
$(function() {
	$( "#tabs" ).tabs({
	    select: function(event, ui) {
	        var url = $.data(ui.tab, 'load.tabs');
	        if( url ) {
	            location.href = url;
	            return false;
	        }
	        return true;
	    },
	selected: 1
	});
});
</script>
<div id="tabs">
	<ul>
    <li><?php echo $this->Html->link(__('Phân loại đoàn viên', true), array('controller'=>'phanloaisvs','action' => 'index')); ?></li>
    <li><a href='#xetut'>Xét đoàn viên ưu tú</a> </li>
    </ul>
<div class="dvutsvs index" id="xetut">
<?php 
    if(isset($error)&&$error!=null) echo $error;
    if(isset($duplicate)) echo $duplicate;
    if(isset($daduyet)) echo $daduyet;
?>
<?php echo $this->Form->create('Dvutsv');?>
	<h2><?php __('Đề nghị đoàn viên ưu tú');?></h2>
    <?php echo $this->Form->input('songuoithamgiabau',array('label'=>'Số người tham gia bầu','value'=>$tongso)); ?>
	<?php echo "Học kỳ: ".$hockyht['Hocky']['tenhocky']; ?>
	<table cellpadding="0" cellspacing="0" id="tables">
	<tr>
            <th><?php __('STT');?></th>
			<th><?php __('MSSV');?></th>
            <th><?php __('Họ tên');?></th>
			<th><?php __('Số người đồng ý');?></th>
			<th><?php __('Ghi chú');?></th>
	</tr>
	<?php
	$i = 0;
    $j=0;
	foreach ($dvutsvs as $dvutsv):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
        <td>
            <?php echo $i; ?>   
            
            <?php 
                if((date('Y-m-d')>=$thoigian['Thoigianchophep']['moc1']&&date('Y-m-d')<=$thoigian['Thoigianchophep']['moc2'])||$dvutsv['Z5plsv']['chinhsua']==1){
                    echo $this->Form->input('sinhvien_id'.$j,array('label'=>'','type'=>'hidden','readonly'=>true,'value'=>$dvutsv['Z5plsv']['sinhvien_id']));
                } 
            ?>         
        </td>
        
        <td>
            <?php 
                if((date('Y-m-d')>=$thoigian['Thoigianchophep']['moc1']&&date('Y-m-d')<=$thoigian['Thoigianchophep']['moc2'])||$dvutsv['Z5plsv']['chinhsua']==1){
                    echo $this->Form->input('mssv'.$j,array('label'=>'','readonly'=>true,'value'=>$dvutsv['Z5plsv']['mssv']));
                } else echo $dvutsv['Z5plsv']['mssv']
            ?>
        </td>
        <td>
            <?php echo $dvutsv['Z5plsv']['hoten'];?>
        </td>
		<td><?php 
                if((date('Y-m-d')>=$thoigian['Thoigianchophep']['moc1']&&date('Y-m-d')<=$thoigian['Thoigianchophep']['moc2'])||$dvutsv['Z5plsv']['chinhsua']==1){
                    echo $this->Form->input('songuoidongy'.$j,array('label'=>''));
                } 
        ?>&nbsp;</td>		
		<td><?php 
                if((date('Y-m-d')>=$thoigian['Thoigianchophep']['moc1']&&date('Y-m-d')<=$thoigian['Thoigianchophep']['moc2'])||$dvutsv['Z5plsv']['chinhsua']==1){
                    echo $this->Form->input('ghichu'.$j,array('label'=>'')); 
                }
                ?>&nbsp;</td>
	</tr>
    <?php $j++;?>
<?php endforeach; ?>
	</table>
<?php echo $this->Form->end(__('Lưu', true));?>
</div>
<?php //echo $this->Html->link(__('Danh sách đoàn viên ưu tú đã được bình xét', true), array('action' => 'viewdvut')); ?></li>
</div>